/**
 * @description 文件上传相关路由
 * @author wen
 * @date 2025.2.10
 * @param {*} router
 * @returns {*}
 */

const express = require('express');
const router = express.Router();
const service=require('../services/common')
const { createUpload } = require('../utils/upload');
const avatarUploader = createUpload({
    storagePath: 'public/common',
    allowedTypes: ['image/jpeg', 'image/png']
  });
router.post('/commonUpload',avatarUploader.single('common'),service.handleCommonUpload)
router.get('/sendCode',service.sendEmail)
router.get('/validateCode',service.validateCode)
router.get('/getStatistics',service.getStatistics)
router.get('/getUserGrowthTrend',service.getUserGrowthTrend)
router.get('/getPostPublishTrend',service.getPostPublishTrend)
module.exports = router;